package com.huizu.project.controller;

import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.huizu.common.annotation.Log;
import com.huizu.common.core.controller.BaseController;
import com.huizu.common.core.domain.AjaxResult;
import com.huizu.common.enums.BusinessType;
import com.huizu.project.domain.ProLd6;
import com.huizu.project.service.IProLd6Service;
import com.huizu.common.utils.poi.ExcelUtil;
import com.huizu.common.core.page.TableDataInfo;

/**
 * 互联网+报告Controller
 * 
 * @author zhangmx
 * @date 2024-05-10
 */
@RestController
@RequestMapping("/project/prold6")
public class ProLd6Controller extends BaseController
{
    @Autowired
    private IProLd6Service proLd6Service;

    /**
     * 查询互联网+报告列表
     */
    @PreAuthorize("@ss.hasPermi('project:prold6:list')")
    @GetMapping("/list")
    public TableDataInfo list(ProLd6 proLd6)
    {
        startPage();
        List<ProLd6> list = proLd6Service.selectProLd6List(proLd6);
        return getDataTable(list);
    }

    /**
     * 导出互联网+报告列表
     */
    @PreAuthorize("@ss.hasPermi('project:prold6:export')")
    @Log(title = "互联网+报告", businessType = BusinessType.EXPORT)
    @PostMapping("/export")
    public void export(HttpServletResponse response, ProLd6 proLd6)
    {
        List<ProLd6> list = proLd6Service.selectProLd6List(proLd6);
        ExcelUtil<ProLd6> util = new ExcelUtil<ProLd6>(ProLd6.class);
        util.exportExcel(response, list, "互联网+报告数据");
    }

    /**
     * 获取互联网+报告详细信息
     */
    @PreAuthorize("@ss.hasPermi('project:prold6:query')")
    @GetMapping(value = "/{id}")
    public AjaxResult getInfo(@PathVariable("id") String id)
    {
        return success(proLd6Service.selectProLd6ById(id));
    }

    /**
     * 新增互联网+报告
     */
    @PreAuthorize("@ss.hasPermi('project:prold6:add')")
    @Log(title = "互联网+报告", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@RequestBody ProLd6 proLd6)
    {
        return toAjax(proLd6Service.insertProLd6(proLd6));
    }

    /**
     * 修改互联网+报告
     */
    @PreAuthorize("@ss.hasPermi('project:prold6:edit')")
    @Log(title = "互联网+报告", businessType = BusinessType.UPDATE)
    @PutMapping
    public AjaxResult edit(@RequestBody ProLd6 proLd6)
    {
        return toAjax(proLd6Service.updateProLd6(proLd6));
    }

    /**
     * 删除互联网+报告
     */
    @PreAuthorize("@ss.hasPermi('project:prold6:remove')")
    @Log(title = "互联网+报告", businessType = BusinessType.DELETE)
	@DeleteMapping("/{ids}")
    public AjaxResult remove(@PathVariable String[] ids)
    {
        return toAjax(proLd6Service.deleteProLd6ByIds(ids));
    }
}
